﻿using Microsoft.EntityFrameworkCore;
using System.Reflection.Metadata;

namespace WcMatch.Models
{
    public partial class StudentContext : DbContext
    {
        public StudentContext()
        {

        }

        public StudentContext(DbContextOptions<StudentContext> options) : base(options) { }

        public virtual DbSet<Student>? Students { get; set; } = null;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8_general_ci").HasCharSet("utf8");

            //public int Id { get; set; }
            //public string UserName { get; set; } = null!;
            //public string PassWord { get; set; } = null!;
            //public string DepartmentName { get; set; } = null!;


            modelBuilder.Entity<Student>(entity =>
            {
                entity.ToTable("T_User_Student");
                //entity.Property(e => e.CitizenId)
                //    .HasMaxLength(200)
                //    .HasColumnName("CitizenId");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);

    }
}
